<?php
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>       
    <link rel="shortcut icon" href="CSS/images/IconeCoteDetente.PNG"/>       
    <meta name="title" content="cote detente"/>       
    <meta name="description" content="Site de cote detente, salon esthetique"/>       
    <meta name="keywords" content="épilation, épilations, massage, massages, ongles, vernis, maquillage, teintures, mariées, mariage, blanchiment des dents,esthétique "/>       
    <meta name="subject" content="esthetique"/>       
    <meta name="author" content="les macarons"/>       
    <meta name="language" content="FR"/>       
    <meta name="robots" content="All"/>
    <title>Côté Détente
    </title>
    <link rel="stylesheet" type="text/css" href="CSS/style.css" />
<script type="text/javascript" src="verification.js"></script>
  </head>
<?php
	
	error_reporting(E_ALL | E_STRICT );
	ini_set('display_errors', true);
	
if (isset($_GET['page']))
{
switch ($_GET['page'])
{
	case 'accueil': $page='accueil.php';
          break;
	case 'S_visage': $page='S_visage.php';
          break;
	case 'S_corps': $page='S_corps.php';
          break;
	case 'S_mains': $page='S_mains.php';
          break;
	case 'S_pieds': $page='S_pieds.php';
          break;
	case 'E_visage': $page='E_visage.php';
          break;
	case 'E_corps': $page='E_corps.php';
          break;
	case 'maquillages': $page='maquillages.php';
          break;
	case 'teintures': $page='teintures.php';
          break;
	case 'mariage': $page='mariage.php';
          break;
	case 'blanchimentDesDents': $page='blanchimentDesDents.php';
          break;
	case 'calendrier': $page='calendrier.php';
          break;
	case 'modifProfil': $page='modifProfil.php';
          break;
	case 'sInscrire': $page='sInscrire.php';
          break;
	case 'contact': $page='contact.php';
          break;   		  
	case 'RDV': $page='RDV.php';
          break;  
	case 'prendre_rdv': $page='prendre_rdv.php';
          break;                      
    default :   $page='accueil.php';
		  break;
}
}
else
$page='accueil.php';
  ?>
  <body>
    <div id="wrapper">
      <div id="all">
        <div id="header">
          <div id="headleft">	
            <a href=".?page=accueil">		
              <img src="CSS/images/logoCoteDetenteBlanc1.jpg" alt="Logo Côté Détente"/>	</a>
          </div>
          <div id="auth">
<?php
if(isset($_SESSION["auth"]) && isset($_SESSION["ID"]))
{ 
include_once "connect.php";
$result=mysql_query("SELECT * FROM ap3_sp_connection WHERE utilisateur=".$_SESSION['auth']." ORDER BY dateco DESC , heure DESC");
$code=mysql_fetch_assoc($result);
if ($_SESSION["ID"]!=$code['code'])
{
    unset($_SESSION["auth"]);
    unset($_SESSION["ID"]);
    header("Location:.");
} 
else //if ($_SESSION["ID"]==$code['code'])
{
//Si utilisateur est identifier alors on affiche le bouton de deconnexion
            ?>    <h3>           
<?php   
                include_once "connect.php";
                $query3 = ("select Prenom from ap3_sp_utilisateur WHERE ID='".$_SESSION["auth"]."'");
                $result2=mysql_query($query3);
                $row2=mysql_fetch_assoc($result2);
                echo $row2["Prenom"];
                     ?>    </h3>    
            <form action='seConnecter.php' method='post'>  
              <p>   
                <input type="submit" name="btLogout" value="Quitter"/>   
            </form>
            </p>        
            <form action='.' method='get'>  
              <p>  
                <input type="hidden" name="page" value="modifProfil"/>     
                <input type="submit" name="Profil" value="Profil"/>   
            </form>
            </p>       
<?php 
   				if($_SESSION["auth"]==0){
            				?> 				  
            <form id="administrer" action='admin/index.php' method="get">					
              <input type="hidden" name="page" value="emplois_temps"/>					
              <input type="submit" value="Administrer"/>				  
            </form>				
<?php 
            				}?>        
<?php
}
 }
else //Si non on affiche la barre de connexion
{  
            ?>
            <!--On coupe le PHP pour le HTML-->      
            <form action='seConnecter.php' name='auth' method='post' onSubmit="return valid()">    
              <p>      
                <input name="mail" value="Email" onFocus="initMail()" onBlur="verifMail()" size='10'/>
                <span class='sep'>            
                  <input name="MDP" value="******" onFocus="initMDP()" onBlur="verifMDP()" size='10' type='password'/>
                  </br>        
                  <input type="submit" name="connexion" value='Connexion'/>    
              </p>  
            </form>  
            <form id="inscription" action='.' method="get">	
              <input type="hidden" name="page" value="sInscrire"/>	
              <input type="submit" value="Inscription"/>  
            </form>
<?php
}//Fin du ELSE
            ?>
          </div>
          <!-- auth -->
        </div>
        <!-- header -->
        <div id="menuPrincipal">
<?php
include('menu.php');
          ?>
        </div>
        <div id="content">	
<?php
	include($page);
          	?>
        </div>
        <!-- content -->
        <div id="footer">
          <p id="droits">Février 2012 - 
            <a href=".">Macarons</a>
          </p> 
          <p id="validationxhtml">    
            <a href="http://validator.w3.org/check?uri=referer">
              <img       src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a>  
          </p>
        </div>
        <div id="extra">
        </div>
        <div id="extra1">
        </div>
        <div id="extraEricson">
        </div>
        <div id="extra2">
        </div>
        <div id="extra3">
        </div>
        <div id="extra4">
        </div>
        <div id="extra5">
        </div>
      </div>
      <!-- all -->
    </div>
    <!-- wrapper -->
    <div id="outer">
    </div>
  </body>
</html>